<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">

    <h:head>
        <title>Predmet</title>
    </h:head>

    <h:body>
        <ui:composition template="templateGeneral.xhtml">
            <ui:define name="center">

                <h:form id="form">  
                    <h:outputText value="#{predmetInfo.predmet.naziv}" 
                                  style="font-size: 18px; font-weight: bold; margin-left: 300px"/>
                    <p:tabView id="tabView" orientation="left" effect="fold">                   
                        <p:tab id="obavestenja" title="Obavestenja">  
                            <c:forEach items="#{predmetInfo.obavestenjaList}" var="obv">
                                <h:panelGrid columns="2"  cellpadding="10" > 
                                    <h:outputText value="#{obv.datum}" style="font-weight: bold"/>
                                    <h:outputText value="#{obv.naslov}" />
                                    <h:outputText value="#{obv.tekst}" />
                                    <h:outputText value="" />
                                    <c:forEach items="#{obv.fajlovis}" var="fajl">
                                        
                                            <h:panelGrid columns="4" cellpadding="10">
                                                <h:outputText value="#{fajl.naziv}" />
                                                <h:outputText value="#{fajl.velicina}KB" />
                                                <h:outputText value="#{fajl.datum}" />

                                            </h:panelGrid>
                                    </c:forEach>
                                    
                                </h:panelGrid> 
                                <p:separator />
                            </c:forEach>
                        </p:tab>  

                        <p:tab id="informacije" title="Informacije"> 
                            <h:panelGrid columns="2" cellpadding="10">  
                                <p:outputLabel value="Sifra:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.sifra}"/>
                                <p:outputLabel value="Tip:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.tip}"/>
                                <p:outputLabel value="ESPB:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.espb}"/>
                                <p:outputLabel value="Semestar:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.semestar}"/>
                                <p:outputLabel value="Fond casova:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.fondCasova}"/>
                                <p:outputLabel value="Tip:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.tip}"/>
                                <p:outputLabel value="Laboratorija:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.lab}"/>
                                <p:outputLabel value="Propozicije:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.propozicije}"/>
                                <p:outputLabel value="Cilj:" style="font-weight: bold"/>
                                <p:outputLabel value="#{predmetInfo.predmet.cilj}"/>								
                            </h:panelGrid>                         
                        </p:tab>  

                        <p:tab id="materijali" title="Materijali">  
                            <p:accordionPanel multiple="true" >
                                <p:tab title="Predavanja"  >
                                    <c:forEach items="#{predmetInfo.predavanja}" var="pred">
                                        <h:panelGrid columns="4" cellpadding="10">
                                            <h:outputText value="#{pred.opis}"/>
                                            <h:outputText value="#{pred.fajlovi.velicina}KB"/>
                                            <h:outputText value="#{pred.fajlovi.datum}"/>
                                            <h:outputText value=""/>
                                        </h:panelGrid>
                                    </c:forEach>
                                </p:tab>

                                <p:tab title="Vezbe">
                                    <c:forEach items="#{predmetInfo.vezbe}" var="vezba">
                                        <h:panelGrid columns="4" cellpadding="10">
                                            <h:outputText value="#{vezba.opis}"/>                                          
                                            <h:outputText value="#{vezba.fajlovi.velicina}KB"/>
                                            <h:outputText value="#{vezba.fajlovi.datum}"/>
                                            <h:outputText value=""/>

                                        </h:panelGrid>
                                    </c:forEach>
                                </p:tab>
                            </p:accordionPanel>  
                        </p:tab>  

                        <p:tab id="ispitniZadatci" title="Ispitni zadatci">  
                            <h:panelGrid columns="6" cellpadding="10">
                                <c:forEach items="#{predmetInfo.rokovi}" var="rok">                                    
                                    <h:outputText value="#{rok.opis}"/>
                                    <h:outputText value="#{rok.fajlovi.velicina}KB"/>
                                    <h:outputText value="#{rok.datum}"/>
                                    <h:outputText value=""/>                                    
                                </c:forEach>
                            </h:panelGrid>
                        </p:tab>  

                        <p:tab id="lab" title="Laboratorija">  
                            <p:accordionPanel multiple="true" >
                                <c:forEach items="#{predmetInfo.labVezbe}" var="labVzb">
                                    <p:tab title="#{labVzb.naziv}">
                                        <p:outputLabel value="#{labVzb.propozicije}"/>
                                        <div style="margin-left: 30px">
                                        <c:forEach items="#{labVzb.fajlovis}" var="fajlLab" >
                                            <h:panelGrid columns="4" cellpadding="10">
                                                <h:outputText value="#{fajlLab.naziv}" />
                                                <h:outputText value="#{fajlLab.velicina}KB" />
                                                <h:outputText value="#{fajlLab.datum}" />
                                            </h:panelGrid>
                                        </c:forEach>
                                        </div>
                                    </p:tab>
                                </c:forEach>
                            </p:accordionPanel>  
                        </p:tab> 

                        <p:tab id="projekat" title="Domaci">  
                            <p:accordionPanel multiple="true" >
                                <c:forEach items="#{predmetInfo.domaci}" var="domZad">
                                    <p:tab title="#{domZad.naziv}">
                                        <p:outputLabel value="#{domZad.propozicije}"/>
                                        <div style="margin-left: 30px">
                                        <c:forEach items="#{domZad.fajlovis}" var="fajlDom" >
                                            <h:panelGrid columns="4" cellpadding="10">
                                                <h:outputText value="#{fajlDom.naziv}" />
                                                <h:outputText value="#{fajlDom.velicina}KB" />
                                                <h:outputText value="#{fajl.datum}" />
                                            </h:panelGrid>
                                        </c:forEach>
                                        </div>
                                    </p:tab>
                                </c:forEach>
                            </p:accordionPanel>   
                        </p:tab> 

                    </p:tabView>  
                </h:form>  
            </ui:define>
        </ui:composition>
    </h:body>
</html>
